import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)


const routes = [
    {
        path: '/',
        component: HomeView,
        redirect: '/admin/index',
        children: [
            /*后台首页*/
            {
                path: '/admin/index',
                component: () => import('../views/admin/IndexView')
            },
            /*基础管理*/
            {
                /*供应商管理*/
                path: '/admin/basic/1',
                component: () => import('../views/admin/basic/BusProviderView')
            },
            {
                /*商品管理*/
                path: '/admin/basic/2',
                component: () => import('../views/admin/basic/BusGoodsView')
            },
            {
                /*客户管理*/
                path: '/admin/basic/3',
                component: () => import('../views/admin/basic/BusCustomerView')
            },

            /*进货管理*/
            {
                /*修改进货*/
                path: '/admin/inport/update',
                component: () => import('../views/admin/inport/修改进货')
            },
            {
                /*进货列表*/
                path: '/admin/inport/list',
                component: () => import('../views/admin/inport/进货列表')
            },

            /*退货管理*/
            {
                /*新增退货数据*/
                path: '/admin/outport/insert',
                component: () => import('../views/admin/outport/新增退货')
            },
            {
                /*修改退货数据*/
                path: '/admin/outport/update',
                component: () => import('../views/admin/outport/修改退货')
            },
            {
                /*退货数据列表*/
                path: '/admin/outport/list',
                component: () => import('../views/admin/outport/退货列表')
            },

            /*库存管理*/
            {
                /*商品库存查询*/
                path: '/admin/repertory/list',
                component: () => import('../views/admin/repertory/RepertoryListView')
            },
            {
                /*商品报销清单*/
                path: '/admin/breakage/show',
                component: () => import('../views/admin/breakage/BreakageListView')
            },

            /*销售管理*/
            {
                /*商品销售*/
                path: '/admin/sale/1',
                component: () => import('../views/admin/sale/商品销售')
            },
            {
                /*销售退货查询*/
                path: '/admin/inport/2',
                component: () => import('../views/admin/sale/销售退货查询')
            },

            /*系统管理*/
            {
                /*用户管理*/
                path: '/admin/sys/2',
                component: () => import('../views/admin/sys/用户管理')
            },
            {
                /*角色管理*/
                path: '/admin/sys/4',
                component: () => import('../views/admin/sys/RoleList')
            },
            {   /*部门管理*/
                path: '/admin/sys/5',
                component: () => import('../views/admin/sys/部门管理')
            },
            {
                /*个人中心*/
                path: '/admin/sys/personal',
                component: () => import('../views/admin/sys/Personal')
            },
            {
                /*个人中心*/
                path: '/admin/sys/updatePassword',
                component: () => import('../views/admin/sys/UpdatePassword')
            },
            {   /*添加部门*/
                path: '/sys/dept/add-new',
                component: () => import('../views/admin/sys/DeptAddNewView')
            },
            {   /*发布通知*/
                path: '/sys/notice/add-new',
                component: () => import('../views/admin/other/NoticeAddNewView')
            },

            /*其他管理*/
            {
                /*日志*/
                path: '/admin/other/1',
                component: () => import('../views/admin/other/LoginLog.vue')
            },
            {
                /*发布通知*/
                path: '/admin/other/2',
                component: () => import('../views/admin/other/发布通知')
            },

        ]
    },
    {
        path: '/login',
        component: () => import('../views/LoginView.vue')
    }

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
